RichTextKit v0.4

Buffer<T> Class

Assembly: Topten.RichTextKit.dll
Namespace: Topten.RichTextKit.Utils

A growable array of elements of type T

public class Buffer<T> :
    IEnumerable<T>

Inheritance

Buffer<T> → object

Interfaces

IEnumerable<T>, System.Collections.IEnumerable

Type Parameters

T

The buffer element type

Constructors

Buffer()

Constructs a new buffer.

Properties

Item[int]

Gets a reference to an element in the buffer

Length

Gets or sets the length of the buffer

Underlying

The data held by this buffer

Methods

Add(Slice<T>)

Add a slice of data to this buffer.

Add(int, bool)

Adds to the buffer, returning a slice of requested size

AsSlice()

Returns the entire buffer contents as a Slice<T>

Clear()

Clears the buffer, keeping the internally allocated array.

Delete(int, int)

Delete a section of the buffer

GetRanges(T)

Split the utf32 buffer on a codepoint type

Insert(int, Slice<T>)

Insert a slice of data into this buffer

Insert(int, int, bool)

Inserts room into the buffer

Replace(T, T)

Replaces all instances of a value in the buffer with another value

Split(T)

Split the utf32 buffer on a codepoint type

SubSlice(int, int)

Returns a range within this buffer as a Slice<T>